package com.qf.student.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author author
 * @since 2022-11-21
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("rc_student")
@ApiModel(value="Student对象", description="")
public class Student implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "student_id", type = IdType.AUTO)
    private Integer studentId;

    @ApiModelProperty(value = "学员班级id", example = "2206")
    private Integer studentClassId;

    @ApiModelProperty(value = "学员编号", example = "1")
    private String studentNumber;

    @ApiModelProperty(value = "学员姓名", example = "张三")
    private String studentName;

    @ApiModelProperty(value = "学员密码", example = "123456")
    private String studentPassword;

    @ApiModelProperty(value = "学员邮箱", example = "zhangsan@qq.com")
    private String studentEmail;

    @ApiModelProperty(value = "学员生日", example = "1999-10-06")
    @DateTimeFormat(pattern = "yyyy-MM-dd" ) //輸入 - 转化前端传入的数据
    @JsonFormat(pattern = "yyyy-MM-dd") //输出 - 转化数据库中的数据
    private Date studentBirthday;

    @ApiModelProperty(value = "学员性别", example = "男")
    private Integer studentSex;

    @ApiModelProperty(value = "最后登录时间", example = "2022-11-11")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime studentLastLoginTime;

    public Student(Integer studentId, LocalDateTime studentLastLoginTime) {
        this.studentId = studentId;
        this.studentLastLoginTime = studentLastLoginTime;
    }

}
